from typing import Iterable, TypeVar, Optional, Callable


T = TypeVar('T')

def first(iterable: Iterable[T]) -> T: ...
def last(iterable: Iterable[T]) -> Optional[T]: ...
def all(iterable: Iterable[T], predicate: Callable[[T], bool]) -> bool: ...
def any(iterable: Iterable[T], predicate: Callable[[T], bool]) -> bool: ...
def join(iterable: Iterable[T], separator: str) -> str: ...
